import requests

url = "http://192.168.10.131:1234/area"

kw1 = {
    "method": "get",
    "url": url + "/listarea",
    "params": None,
    "data": None,
    "json": None,
    "files": None,
    "headers": None
}

response = requests.request(**kw1)

# 行解析
print("URL: ", response.url)
print("状态码", response.status_code)

# 头解析
print("所有headers信息: ", response.headers)
print("headers指定信息: ", response.headers.get("Content-Type"))
print("所有cookies信息: ", response.cookies) # 可以通过 .items() 方法遍历每个 cookie 信息

# 遍历 cookies
for name, value in response.cookies.items():
    print(name, value)

# 体解析
print("以文本方式获取body(类型为str):", response.text)
print("以JSON格式获取body(类型为dict):", response.json())

